package com.xinhua.wuye.dao;

import java.util.ArrayList;
import java.util.List;

import com.xinhua.wuye.bean.Bill;

public class BillDAO {
	private List<Bill> bills = new ArrayList<>();
	
	public List<Bill> getBills(){
		return bills;
	}
	
	public void addBill(Bill bill) {
		bills.add(bill);	
	}
	
	public List<Bill> getBillByResidentId(String id) {
		List<Bill> subList = new ArrayList<>();
		for(Bill b:bills) {
			if(b.getResidentId().equals(id)) {
				subList.add(b);
			}
		}
		return subList;
	}
}	
